package com.nuc.bigdata.model;

/**
 * 异常编码和摘要的枚举类
 * @author JackLuo
 * @date 2019/10/30
 */
public enum ResultCode {
    /**
     * 枚举类中初始化定义的构造方法实例，需要写在类开头
     */
    /*成功状态码*/
    SUCCESS(1,"成功"),
    /*参数错误：1001-1999*/
    PARAM_IS_INVALID(1001,"参数无效"),
    PARAM_IS_BLANK(1002,"参数为空"),
    PARAM_TYPE_BIND_ERROR(1003,"参数类型错误"),
    PARAM_NOT_COMPLETE(1004,"参数缺失"),
    /*用户错误：2001-2999*/
    USER_NOT_LOGGED_IN(2001,"用户未登录，访问的路径需要验证，请登录"),
    USER_LOGIN_ERROR(2002,"账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003,"账号已被禁用"),
    USER_NOT_EXIST(2004,"用户不存在"),
    USER_HAS_EXISTED(2005,"用户已存在"),
    USER_PASSWORD_ERROR(2006,"用户密码错误"),
    USER_ACCOUNT_NOT_PERMISSION(2007,"用户无权限"),
    /*评论点赞错误*/
    COMMENT_LIKE_IS_EXIST(20010,"用户已点过赞"),
    /*图片菜单资讯异常*/
    PHOTO_MENU_IS_EXIST(20020,"该菜单已存在"),
    PHOTO_MENU_NOT_EXIST(20021,"该菜单不存在"),
    PHOTO_NEWS_CATEGORY_NOT_EXIST(20022,"图片资讯所属类别不存在"),
    PHOTO_NEWS_IS_EXIST(20025,"图片资讯已存在"),
    PHOTO_NEWS_NOT_EXIST(20026,"图片资讯不存在"),
    /*服务器内部错误：500*/
    WEB_ERROR(500,"服务器异常")
    ;



    private Integer code;
    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
